﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys5a00
    {
		private string _listid;
		private string _pagename;
		private string _ctlname;
        private int? _colsize;
		private string _pagetitle;
        private DateTime? _lsttime;
		private string _remark;
		
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 页面名称
        /// </summary>
		public string Pagename
		{
			get { return _pagename;	 }
			set { _pagename=value;	}
		}
        /// <summary>
        /// 控件标识
        /// </summary>
		public string Ctlname
		{
			get { return _ctlname;	 }
			set { _ctlname=value;	}
		}
        /// <summary>
        /// 每行显示字段数
        /// </summary>
		public int? Colsize
		{
			get { return _colsize;	 }
			set { _colsize=value;	}
		}
        /// <summary>
        /// 页面标题
        /// </summary>
		public string Pagetitle
		{
			get { return _pagetitle;	 }
			set { _pagetitle=value;	}
		}
        /// <summary>
        /// 最后更新时间
        /// </summary>
		public DateTime? Lsttime
		{
			get { return _lsttime;	 }
			set { _lsttime=value;	}
		}
        /// <summary>
        /// 简要说明
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
		
		public static List<Sys5a00> GetSys5a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys5a00> list = new List<Sys5a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys5a00 model = GetSys5a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys5a00 GetSys5a00ByDataRow(DataRow dr)
		{
			Sys5a00 model = new Sys5a00(); //实例化Sys5a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("pagename")&&!(dr["pagename"] is System.DBNull))  
				model.Pagename = ( string)dr["pagename"];
			if (dcc.Contains("ctlname")&&!(dr["ctlname"] is System.DBNull))  
				model.Ctlname = ( string)dr["ctlname"];
			if (dcc.Contains("colsize")&&!(dr["colsize"] is System.DBNull))  
				model.Colsize = ( int)dr["colsize"];
			if (dcc.Contains("pagetitle")&&!(dr["pagetitle"] is System.DBNull))  
				model.Pagetitle = ( string)dr["pagetitle"];
			if (dcc.Contains("lsttime")&&!(dr["lsttime"] is System.DBNull))  
				model.Lsttime = ( DateTime)dr["lsttime"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			
			return model;
		}
    }
}
